var utilMd5 = require('~/utils/md5')
import {
  modifyPassword
} from '../../../services/api/menber'
Page({
  data: {
    nameValue: '',
    newPassWord: '',
    oldPassWord: ''
  },
  async onSubmit() {

    let {
      code,
      data
    } = await modifyPassword({
      "newPassWord": utilMd5.hexMD5(this.data.newPassWord).toUpperCase(),
      "oldPassWord": utilMd5.hexMD5(this.data.oldPassWord).toUpperCase()
    })
    if (data) {
      wx.navigateBack({
        delta: 0
      })
    }
  },
  clearContent(e) {
    const key = e.currentTarget.dataset.key;
    this.setData({
      [key]: ''
    })
  },
});